<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button>显示当前时间</button>
    <div class="div">某个时间</div>
    <script>

        var date = new Date();
        var btn = document.querySelector('button');
        var div = document.querySelector('div');
        btn.onclick = function () {
           div.innerText = date.getDay();
        }
    </script>
</body>
</html>